<!--
// +----------------------------------------------------------------------
// | Created by PHPstorm: JRKAdmin框架 [ JRKAdmin ]
// +----------------------------------------------------------------------
// | Copyright (c) 2019~2022 [LuckyHHY] All rights reserved.
// +----------------------------------------------------------------------
// | SiteUrl: http://www.luckyhhy.cn
// +----------------------------------------------------------------------
// | Author: LuckyHhy <jackhhy520@qq.com>
// +----------------------------------------------------------------------
// | Date: 2020/3/10-16:33
// +----------------------------------------------------------------------
// | Description:
// +----------------------------------------------------------------------
*-->


{extend name='public/window' /}


{block name="content"}


<div class="layui-fluid">
    <div class="layui-card">

        <div class="layui-card-body" style="padding: 15px;">
            <div class="layui-form"  lay-filter="component-form-group">

                <div class="layui-form-item">
                    <label class="layui-form-label">选择相册：</label>
                    <div class="layui-input-block">
                        <select name="id" lay-search="" lay-verify="required" lay-vertype="tips" lay-reqtext="请选择相册">
                            <option value="0" >请选择相册</option>
                            {volist name="data" id="t"}
                            <option value="{$t.id}" >{$t.name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">相册图片：</label>
                    <div class="layui-input-block input-custom-width" style="">
                        {:widget('common/forms/uploadMultImg',array('img',''))}
                        <p class="help-block">每次最多上传30张</p>
                    </div>
                </div>

                {:widget('common/forms/submit',array('add','立即提交',2))}

            </div>
        </div>
    </div>
</div>



<script>
    layui.use(['element', 'form', 'jquery','lucky'], function () {
        let element = layui.element;
        let table = layui.table;
        let form = layui.form;
        let $ = layui.jquery;
        let lucky=layui.lucky;

        //提交
        form.on('submit(add)', function (data){
            let img = $('#img').val();
           /* if(img==""){
                layer.msg('最少上传一张图片', {icon: 2, anim: 6, time: 1000});
                return false;
            }*/
            lucky.FormSubmit("{:url('album/addImages')}",data.field,"table_id",1);
            return false;
        });
    })
</script>

{/block}

